{% extends "base.html" %}

{% block title %}
	Edit Post
{% endblock %}

{% block extrahead %}
<script type="text/javascript" src="/appmedia/tiny_mce/tiny_mce.js"></script>

<script language="JavaScript" type="text/javascript">
tinyMCE.init({
	mode : "textareas",
	theme : "advanced",
	theme_advanced_buttons1 : "undo,redo,separator,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,link,unlink,separator,blockquote,image,removeformat,code",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_statusbar_location : "bottom",
	extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
});
</script>

<style>
	input {width:auto;}
	
	#add_table {
		font-weight: bold;
	}
	
	#add_table input {
		width:600px;
		border:1px solid #aaaaaa;
		padding: 4px;
	}
	
	#add_table textarea {
		width:780px;
		height:400px;
		border:1px solid #aaaaaa;
	}
	
</style>
{% endblock %}

{% block content %}
<h1>Edit Post</h1>

<div>
	{{form.errors}}
</div>

	<form id="edit_form" method="POST" action=''>
		<div id="add_table">
			Title:
			<br />
			{{ form.title }}
			<br />
			<br />
			
			{{ form.text }}
		</div>
		<br />
		
		<input type="submit" value="Save post"/>
		or
		<a href="/blog/">
		Cancel
		</a>
	</form>
</div>

<script type="text/javascript">
	document.getElementById('id_title').focus()
</script>
{% endblock %}